﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class UnityEngineRenderingCullingResultsWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(UnityEngine.Rendering.CullingResults);
			Utils.BeginObjectRegister(type, L, translator, 1, 11, 6, 0);
			Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__eq", __EqMeta);
            
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "FillLightAndReflectionProbeIndices", _m_FillLightAndReflectionProbeIndices);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetLightIndexMap", _m_GetLightIndexMap);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetLightIndexMap", _m_SetLightIndexMap);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetReflectionProbeIndexMap", _m_GetReflectionProbeIndexMap);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetReflectionProbeIndexMap", _m_SetReflectionProbeIndexMap);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetShadowCasterBounds", _m_GetShadowCasterBounds);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "ComputeSpotShadowMatricesAndCullingPrimitives", _m_ComputeSpotShadowMatricesAndCullingPrimitives);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "ComputePointShadowMatricesAndCullingPrimitives", _m_ComputePointShadowMatricesAndCullingPrimitives);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "ComputeDirectionalShadowMatricesAndCullingPrimitives", _m_ComputeDirectionalShadowMatricesAndCullingPrimitives);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Equals", _m_Equals);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetHashCode", _m_GetHashCode);
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "visibleLights", _g_get_visibleLights);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "visibleOffscreenVertexLights", _g_get_visibleOffscreenVertexLights);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "visibleReflectionProbes", _g_get_visibleReflectionProbes);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "lightIndexCount", _g_get_lightIndexCount);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "reflectionProbeIndexCount", _g_get_reflectionProbeIndexCount);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "lightAndReflectionProbeIndexCount", _g_get_lightAndReflectionProbeIndexCount);
            
			
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
			
			
            
			
			
			
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				
				if (LuaAPI.lua_gettop(L) == 1)
				{
				    translator.Push(L, default(UnityEngine.Rendering.CullingResults));
			        return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Rendering.CullingResults constructor!");
            
        }
        
		
        
		
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __EqMeta(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
			
				if (translator.Assignable<UnityEngine.Rendering.CullingResults>(L, 1) && translator.Assignable<UnityEngine.Rendering.CullingResults>(L, 2))
				{
					UnityEngine.Rendering.CullingResults leftside;translator.Get(L, 1, out leftside);
					UnityEngine.Rendering.CullingResults rightside;translator.Get(L, 2, out rightside);
					
					LuaAPI.lua_pushboolean(L, leftside == rightside);
					
					return 1;
				}
            
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to right hand of == operator, need UnityEngine.Rendering.CullingResults!");
            
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_FillLightAndReflectionProbeIndices(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.ComputeBuffer>(L, 2)) 
                {
                    UnityEngine.ComputeBuffer _computeBuffer = (UnityEngine.ComputeBuffer)translator.GetObject(L, 2, typeof(UnityEngine.ComputeBuffer));
                    
                    gen_to_be_invoked.FillLightAndReflectionProbeIndices( _computeBuffer );
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 0;
                }
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.GraphicsBuffer>(L, 2)) 
                {
                    UnityEngine.GraphicsBuffer _buffer = (UnityEngine.GraphicsBuffer)translator.GetObject(L, 2, typeof(UnityEngine.GraphicsBuffer));
                    
                    gen_to_be_invoked.FillLightAndReflectionProbeIndices( _buffer );
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Rendering.CullingResults.FillLightAndReflectionProbeIndices!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetLightIndexMap(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    Unity.Collections.Allocator _allocator;translator.Get(L, 2, out _allocator);
                    
                        var gen_ret = gen_to_be_invoked.GetLightIndexMap( _allocator );
                        translator.Push(L, gen_ret);
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_SetLightIndexMap(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    Unity.Collections.NativeArray<int> _lightIndexMap;translator.Get(L, 2, out _lightIndexMap);
                    
                    gen_to_be_invoked.SetLightIndexMap( _lightIndexMap );
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetReflectionProbeIndexMap(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    Unity.Collections.Allocator _allocator;translator.Get(L, 2, out _allocator);
                    
                        var gen_ret = gen_to_be_invoked.GetReflectionProbeIndexMap( _allocator );
                        translator.Push(L, gen_ret);
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_SetReflectionProbeIndexMap(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    Unity.Collections.NativeArray<int> _lightIndexMap;translator.Get(L, 2, out _lightIndexMap);
                    
                    gen_to_be_invoked.SetReflectionProbeIndexMap( _lightIndexMap );
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetShadowCasterBounds(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    int _lightIndex = LuaAPI.xlua_tointeger(L, 2);
                    UnityEngine.Bounds _outBounds;
                    
                        var gen_ret = gen_to_be_invoked.GetShadowCasterBounds( _lightIndex, out _outBounds );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    translator.PushUnityEngineBounds(L, _outBounds);
                        
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 2;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_ComputeSpotShadowMatricesAndCullingPrimitives(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    int _activeLightIndex = LuaAPI.xlua_tointeger(L, 2);
                    UnityEngine.Matrix4x4 _viewMatrix;
                    UnityEngine.Matrix4x4 _projMatrix;
                    UnityEngine.Rendering.ShadowSplitData _shadowSplitData;
                    
                        var gen_ret = gen_to_be_invoked.ComputeSpotShadowMatricesAndCullingPrimitives( _activeLightIndex, out _viewMatrix, out _projMatrix, out _shadowSplitData );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    translator.Push(L, _viewMatrix);
                        
                    translator.Push(L, _projMatrix);
                        
                    translator.Push(L, _shadowSplitData);
                        
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 4;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_ComputePointShadowMatricesAndCullingPrimitives(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    int _activeLightIndex = LuaAPI.xlua_tointeger(L, 2);
                    UnityEngine.CubemapFace _cubemapFace;translator.Get(L, 3, out _cubemapFace);
                    float _fovBias = (float)LuaAPI.lua_tonumber(L, 4);
                    UnityEngine.Matrix4x4 _viewMatrix;
                    UnityEngine.Matrix4x4 _projMatrix;
                    UnityEngine.Rendering.ShadowSplitData _shadowSplitData;
                    
                        var gen_ret = gen_to_be_invoked.ComputePointShadowMatricesAndCullingPrimitives( _activeLightIndex, _cubemapFace, _fovBias, out _viewMatrix, out _projMatrix, out _shadowSplitData );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    translator.Push(L, _viewMatrix);
                        
                    translator.Push(L, _projMatrix);
                        
                    translator.Push(L, _shadowSplitData);
                        
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 4;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_ComputeDirectionalShadowMatricesAndCullingPrimitives(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    int _activeLightIndex = LuaAPI.xlua_tointeger(L, 2);
                    int _splitIndex = LuaAPI.xlua_tointeger(L, 3);
                    int _splitCount = LuaAPI.xlua_tointeger(L, 4);
                    UnityEngine.Vector3 _splitRatio;translator.Get(L, 5, out _splitRatio);
                    int _shadowResolution = LuaAPI.xlua_tointeger(L, 6);
                    float _shadowNearPlaneOffset = (float)LuaAPI.lua_tonumber(L, 7);
                    UnityEngine.Matrix4x4 _viewMatrix;
                    UnityEngine.Matrix4x4 _projMatrix;
                    UnityEngine.Rendering.ShadowSplitData _shadowSplitData;
                    
                        var gen_ret = gen_to_be_invoked.ComputeDirectionalShadowMatricesAndCullingPrimitives( _activeLightIndex, _splitIndex, _splitCount, _splitRatio, _shadowResolution, _shadowNearPlaneOffset, out _viewMatrix, out _projMatrix, out _shadowSplitData );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    translator.Push(L, _viewMatrix);
                        
                    translator.Push(L, _projMatrix);
                        
                    translator.Push(L, _shadowSplitData);
                        
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 4;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_Equals(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.Rendering.CullingResults>(L, 2)) 
                {
                    UnityEngine.Rendering.CullingResults _other;translator.Get(L, 2, out _other);
                    
                        var gen_ret = gen_to_be_invoked.Equals( _other );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 1;
                }
                if(gen_param_count == 2&& translator.Assignable<object>(L, 2)) 
                {
                    object _obj = translator.GetObject(L, 2, typeof(object));
                    
                        var gen_ret = gen_to_be_invoked.Equals( _obj );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Rendering.CullingResults.Equals!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetHashCode(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    
                        var gen_ret = gen_to_be_invoked.GetHashCode(  );
                        LuaAPI.xlua_pushinteger(L, gen_ret);
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_visibleLights(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                translator.Push(L, gen_to_be_invoked.visibleLights);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_visibleOffscreenVertexLights(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                translator.Push(L, gen_to_be_invoked.visibleOffscreenVertexLights);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_visibleReflectionProbes(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                translator.Push(L, gen_to_be_invoked.visibleReflectionProbes);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_lightIndexCount(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.lightIndexCount);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_reflectionProbeIndexCount(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.reflectionProbeIndexCount);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_lightAndReflectionProbeIndexCount(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Rendering.CullingResults gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.lightAndReflectionProbeIndexCount);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        
        
		
		
		
		
    }
}
